package zhr.chapter13;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Example13_2 {
    public static void main(String[] args) {
        try {
            InetAddress ip=InetAddress.getByName("www.shengda.edu.cn");
            System.out.println("InetAddress对应的IP地址为："+ip.getHostAddress()+",");
            System.out.println("主机名为:"+ip.getHostName()+".");
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }

    }
}
